package com.version1_1.model;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by reeves on 2015/12/23.
 */

// 主界面分页数据model
public class MainPageModel implements JsonSerializable{

    // model property
    private List<Map> pageList;
    boolean isLast;
    List<Map> titleList;

    public MainPageModel(){
        pageList = null;
        isLast = true;
        titleList = null;
    }

    public MainPageModel(List pageList, boolean isLast, List titleList){
        this.pageList = pageList;
        this.titleList = titleList;
        this.isLast = isLast;
    }

    public List<Map> getPageList() {
        return pageList;
    }

    public boolean isLast() {
        return isLast;
    }

    public List<Map> getTitleList() {
        return titleList;
    }

    public void setPageList(List<Map> pageList) {
        this.pageList = pageList;
    }

    public void setLast(boolean last) {
        isLast = last;
    }

    public void setTitleList(List<Map> titleList) {
        this.titleList = titleList;
    }


    @Override
    public String jsonSerialize() {
        Map<String, Object> getMainPageMap = new HashMap<>();
        getMainPageMap.put("isLast", isLast);
        getMainPageMap.put("result", pageList);
        getMainPageMap.put("title", titleList);
        return JSON.toJSONString(getMainPageMap);
    }
}
